; ; DTLocaleLib example ; ; we open the sys/installer.catalog ; try also another catalogs with various id nr... ; FindScreen 0 Window 0,10,10,300,230,$10000+$400+14,"DTLocaleLib test",0,0 ; ; DTLocaleOpen{t$} tries to open the catalog; the locale.library tries to find the catalog ; for the preffered language (locale-preference) ; If DTLocaleOpen{"sys/installer.catalog"} yID.l = ; ; DTLocaleOpen{t$}=true --> catalog sucessfully opened ; NPrint "using catalog" NPrint "" Else ; ; DTLocaleOpen{t$} fails if the locale.library V38 couldn't ; be opened or there is no such catalog in your preffered ; language set in the locale-preference ; Build-in Strings will be used instead. ; NPrint "couldn't open catalog" NPrint "or locale.library !" NPrint "using built-in strings instead !" NPrint "" EndIf ; ; read the Localestrings id 0 - 100 ; For a=0 To 100 ; ; DTLocaleGetStr{nr,tx$} returns the locale-string ; if DTLocaleOpen{t$} failed or there is no catalog, ; or there is no string it returns ; ; t$=DTLocaleGetStr{a,"built in string"} Format "000" NPrint Str$(a)+" : "+t$ VWait 3 WPrintScroll Next a ; ; *** NOTE : Do not forget to close a catalog when exiting ! ; ; DTLocaleClose{} closes the catalog ; it makes no difference if or why DTLocaleOpen{t$} failed ; DTLocaleClose{} Repeat ev.l=WaitEvent ; Wait for IDCMP_CLOSEWINDOW Until ev=$200 CloseWindow 0 End